Folder create() command intricacies

Hello,

I am attempting to create a folder within a current project using the create command, but it does not seem to actually create the folder. I have the following setup:
 

string ProgramName = "Program"
string FolderName = "New Folder"
 
string Location = "/Project/Folder1/Folder2/Folder3"
//Creates the concatenated path to a folder that already exists.
string ProgramDev = Location "/" ProgramName
 
//Set the location of the folder to be created
current = folder ProgramDev
 
//This will create the folder using the user entered name
//I leave the second string empty because I am not going to fill in the description.
Folder create(string FolderName)
 
infobox "Folder created, Please Close Create Folder Prompt"

 


I am attempting to use the hierarchy setting the location of creation then giving it the name. When I run this code it runs without reporting errors but I go to the path location and the folder is not created. Is there something I am missing? Trying to do babysteps here for a larger copy/paste modules for multiple reproductions. Any thoughts?

Thanks
Andrew

 


SystemAdmin - Wed Nov 21 12:24:55 EST 2012

Re: Folder create() command intricacies
MichaelGeorg - Thu Nov 22 09:40:58 EST 2012

Hello awcook1,

actually I also don't know what happens if you execute:

Folder create(string FolderName)


Normally I would think that you should get a DXL error, because the second parameter in create function for folders isn't optional and therefore mustn't be omitted. So perhaps the DXL compilier gets as confused as I by your cast of the string variable FolderName into a string. (>ou don't need to do a cast here)

If you want to create a folder without a description you can do that by:

 

Folder f = create(FolderName, "")

 


or better by:

 

 

 

Folder f
string ErrorMessage = create(FolderName, "" , f)
if(ErrorMessage != "") {
    //deal with error - e.g. with  print ErrorMessage
}


in this way you will recognize if the operation fails.
Just as a hint:
That you have created a folder does not mean you can see it in your DOORS Explorer. So to make the new folder(s) visible you need to update your DOORS Explorer via view menu.

- Michael

 

Re: Folder create() command intricacies
llandale - Mon Nov 26 12:29:07 EST 2012

MichaelGeorg - Thu Nov 22 09:40:58 EST 2012

Hello awcook1,

actually I also don't know what happens if you execute:

Folder create(string FolderName)


Normally I would think that you should get a DXL error, because the second parameter in create function for folders isn't optional and therefore mustn't be omitted. So perhaps the DXL compilier gets as confused as I by your cast of the string variable FolderName into a string. (>ou don't need to do a cast here)

If you want to create a folder without a description you can do that by:

 

Folder f = create(FolderName, "")

 


or better by:

 

 

 

Folder f
string ErrorMessage = create(FolderName, "" , f)
if(ErrorMessage != "") {
    //deal with error - e.g. with  print ErrorMessage
}


in this way you will recognize if the operation fails.
Just as a hint:
That you have created a folder does not mean you can see it in your DOORS Explorer. So to make the new folder(s) visible you need to update your DOORS Explorer via view menu.

- Michael

 

refreshDBExplorer()

Re: Folder create() command intricacies
SystemAdmin - Mon Nov 26 16:14:35 EST 2012

I was missing the refreshDBExplorer() command, Thanks

Re: Folder create() command intricacies
llandale - Tue Nov 27 12:52:43 EST 2012

SystemAdmin - Mon Nov 26 16:14:35 EST 2012
I was missing the refreshDBExplorer() command, Thanks

It is a written function, not a language perm.